package com.news.biz.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.news.biz.News_DetailBiz;
import com.news.dao.News_DetailDao;
import com.news.entity.News_Detail;

@Service("detailBiz")
public class News_DetailBizImpl implements News_DetailBiz {
	
	@Autowired
	private News_DetailDao news_CategoryDao;
	

	public List<News_Detail> getAll() {
		return news_CategoryDao.getAll();
	}

	public List<News_Detail> getNews_DetailsByNameWithCategoryId(String name,
			int categoryId) {
		return news_CategoryDao.getNews_DetailsByNameWithCategoryId(name, categoryId);
	}

	public News_Detail getNews_DetailById(int id) {
		return news_CategoryDao.getNews_DetailById(id);
	}

	@Transactional(propagation=Propagation.REQUIRED)
	public void updateNews_Detail(News_Detail nDetail) {
		news_CategoryDao.updateNews_Detail(nDetail);

	}

}
